package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.MissionCenterAddDTO;
import org.jsola.hr.dto.MissionCenterExportWrongDTO;
import org.jsola.hr.dto.MissionCenterExtraAddDTO;
import org.jsola.hr.dto.MissionCenterUpdateDTO;
import org.jsola.hr.query.MissionCenterQuery;
import org.jsola.hr.vo.MissionCenterImportVO;
import org.jsola.hr.vo.MissionCenterListVO;
import org.jsola.hr.vo.MissionCenterStatisticsVO;
import org.jsola.hr.vo.MissionCenterVO;
import org.jsola.user.entity.UserDO;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 任务调度中心任务表
 *
 * @author zhr
 */
@Api(tags = "hr-任务调度中心任务表")
public interface IMissionCenterControllerAPI {

    /**
     * 新增任务调度中心任务表
     *
     * @param missionCenterAddDTO 任务调度中心任务表新增实体
     * @return 任务调度中心任务表展示对象
     */
    @ApiOperation(value = "新增任务调度中心任务表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "missionCenterAddDTO", dataType = "MissionCenterAddDTO", value = "新增任务调度中心任务表", paramType = "body")
    })
    Result<MissionCenterVO> save(MissionCenterAddDTO missionCenterAddDTO);


    /**
     * 修改任务调度中心任务表
     *
     * @param missionCenterUpdateDTO 任务调度中心任务表
     * @return 更新数量
     */
    @ApiOperation(value = "修改任务调度中心任务表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "missionCenterUpdateDTO", dataType = "MissionCenterUpdateDTO", value = "修改任务调度中心任务表", paramType = "body")
    })
    Result<Integer> update(MissionCenterUpdateDTO missionCenterUpdateDTO);


    /**
     * 删除单个任务调度中心任务表，彻底删除
     *
     * @param missionCenterId 任务调度中心任务表id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个任务调度中心任务表，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "missionCenterId", dataType = "String", value = "任务调度中心任务表id", paramType = "path")
    })
    Result<Integer> delete(String missionCenterId);


    /**
     * 批量删除任务调度中心任务表，彻底删除
     *
     * @param missionCenterIds 任务调度中心任务表id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除任务调度中心任务表，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "missionCenterIds", dataType = "String[]", value = "任务调度中心任务表id数组", paramType = "body", allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] missionCenterIds);


    /**
     * 根据任务调度中心任务表id查询任务调度中心任务表详情
     *
     * @param missionCenterId 任务调度中心任务表id
     * @return 任务调度中心任务表详情
     */
    @ApiOperation(value = "根据任务调度中心任务表id查询任务调度中心任务表详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "missionCenterId", dataType = "String", value = "任务调度中心任务表id", paramType = "path")
    })
    Result<MissionCenterVO> findById(String missionCenterId);


    /**
     * 查询任务调度中心任务表
     *
     * @param missionCenterQuery 任务调度中心任务表查询参数
     * @return page
     */
    @ApiOperation(value = "查询任务调度中心任务表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "missionCenterQuery", dataType = "MissionCenterQuery", value = "任务调度中心任务表查询参数", paramType = "query")
    })
    Result<List<MissionCenterListVO>> listAll(MissionCenterQuery missionCenterQuery);


    /**
     * 分页查询任务调度中心任务表
     *
     * @param missionCenterQuery 任务调度中心任务表查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询任务调度中心任务表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "missionCenterQuery", dataType = "MissionCenterQuery", value = "任务调度中心任务表查询参数", paramType = "query")
    })
    Result<Page<MissionCenterListVO>> page(MissionCenterQuery missionCenterQuery);


    /**
     * 解析导入文件
     *
     * @param file 文件
     * @return 解析结果
     */
    @ApiOperation(value = "解析导入文件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file",
                    value = "文件，Content-Type需要设置为multipart/form-data",
                    paramType = "form")
    })
    Result<MissionCenterImportVO> parseImport(MultipartFile file);

    /**
     * Excel数据入库
     *
     * @param missionCenterExtraAddDTO 保存参数
     * @return 保存条数
     */
    @ApiOperation(value = "Excel数据入库")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "missionCenterExtraAddDTO", dataType = "MissionCenterExtraAddDTO",
                    value = "保存参数", paramType = "body")
    })
    Result<Integer> saveExcel(MissionCenterExtraAddDTO missionCenterExtraAddDTO);

    /**
     * 查询派单顶部统计
     *
     * @param missionCenterQuery 查询参数
     * @return 统计信息
     */
    @ApiOperation(value = "查询派单顶部统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "missionCenterQuery", dataType = "MissionCenterQuery", value = "查询参数", paramType = "query")
    })
    Result<MissionCenterStatisticsVO> selectTopStatistics(MissionCenterQuery missionCenterQuery);

    /**
     * 查询某个任务顶部人数统计
     *
     * @param missionCenterId 任务Id
     * @return 统计信息
     */
    @ApiOperation(value = "查询接单顶部统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "missionCenterId", dataType = "String", value = "任务Id", paramType = "path")
    })
    Result<MissionCenterStatisticsVO> selectReceiveTopStatistics(String missionCenterId);

    /**
     * 查询接单顶部统计
     *
     * @param missionCenterQuery 查询参数
     * @return 统计信息
     */
    @ApiOperation(value = "查询接单顶部统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "missionCenterQuery", dataType = "MissionCenterQuery", value = "查询参数", paramType = "query")
    })
    Result<MissionCenterStatisticsVO> selectAllReceiveTopStatistics(MissionCenterQuery missionCenterQuery);

    /**
     * 接单人员查看自己有权限看见的任务
     *
     * @param missionCenterQuery 查询条件
     * @return 任务
     */
    @ApiOperation(value = "接单人员查看自己有权限看见的任务")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "missionCenterQuery", dataType = "MissionCenterQuery", value = "查询参数", paramType = "query")
    })
    Result<Page<MissionCenterListVO>> viewMission(MissionCenterQuery missionCenterQuery);

    /**
     * 确认接单
     *
     * @param missionCenterId 任务Id
     * @return 接单结果
     */
    @ApiOperation(value = "确认接单")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "missionCenterId", dataType = "String", value = "任务Id", paramType = "path")
    })
    Result<Boolean> confirmReceive(String missionCenterId);

    /**
     * 错误数据导出
     *
     * @param exportWrongDTO 导出参数
     * @return excel
     */
    @ApiOperation(value = "错误数据导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "exportWrongDTO", dataType = "MissionCenterExportWrongDTO", value = "导出参数", paramType = "body")
    })
    ResponseEntity<Resource> exportWrongsData(MissionCenterExportWrongDTO exportWrongDTO);

    /**
     * 查询站点下所有派过单的人员,供前端筛选
     *
     * @param tokenUser 当前用户
     * @return 人员
     */
    @ApiOperation(value = "查询站点下所有派过单的人员")
    Result<List<UserDO>> selectAllCreateUserBySite();
}

